/*
 * @Description:批次管理
 */
import request from '@/utils/request'
export default {
    //添加
    add(data) {
        return request.post(`/fish/batch/batch/add`, { breedType: sessionStorage.breedType, ...data })
    },
    //编辑
    edit(data) {
        return request.post(`/fish/batch/batch/edit`, { breedType: sessionStorage.breedType, ...data })
    },
    //批量删除
    delList(list) {
        return request.get(`/fish/batch/batch/delListById?idList=${list}`)
    },
    //条件查询
    queryByCondition(data) {
        return request.post(`/fish/batch/batch/queryByCondition`, { breedType: sessionStorage.breedType, ...data })
    },
    
    //主键查询
    queryById(id) {
        return request.get(`/fish/batch/batch/queryById?id=${id}`)
    },
    //分页查询
    queryPageByCondition(data) {
        data.entity = !data.entity ? {} : data.entity
        // data.entity.breedType = sessionStorage.breedType;
        return request.post(`/fish/batch/batch/queryPageByCondition`, { ...data })
    },
    //分页树查询
    queryTreePageByCondition(data) {
        data.entity = !data.entity ? {} : data.entity
        // data.entity.breedType = sessionStorage.breedType;
        return request.post(`/fish/batch/batch/queryTreePageByCondition`, { ...data })
    },
    //在塘养殖信息
    queryByConditionBatchPond(data) {
        return request.post(`/fish/batch/batchPond/queryByCondition`, { ...data })
    },
    //批次完成
    completeBatch(batchId) {
        return request.get(`/fish/batch/batch/completeBatch?id=${batchId}`)
    },
    // 分页查询批次及批次投塘信息详情
    queryPageByBatchPond(data) {
        data.entity = !data.entity ? {} : data.entity
        return request.post(`/fish/batch/batch/queryPageByBatchPond`, { ...data })
    },
    //查询批次汇总信息
    queryAllByBatchId(batchId) {
        return request.get(`/fish/batch/batch/queryAllByBatchId?batchId=${batchId}`)
    },
    //编辑占比
    editRatio(pondRatioList) {
        return request.post(`/fish/batch/batch/editRatio`, pondRatioList)
    },
    //查询养殖饲料比数据
    queryFeedRatio(params) {
        return request.post(`/fish/base/breedingFeedRatio/queryFeedRatio`, params)
    },
};
